//
//  MusicIntro.m
//  A_program
//
//  Created by 杨利佳 on 15/5/25.
//  Copyright (c) 2015年 BayMax. All rights reserved.
//

#import "MusicIntro.h"

@implementation MusicIntro

- (void)dealloc
{
    [_view release];
    [_scroll release];
    [_title release];
    [_name release];
    [_creater release];
    [_intro release];
    [super dealloc];
}

- (instancetype)initWithFrame:(CGRect)frame
{
    if (self = [super initWithFrame:frame]) {
        [self createView];
    }
    return self;
}


- (void)createView
{
    // 模拟导航栏的view
    UIView *topView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, self.frame.size.width, 60)];
    topView.backgroundColor = [UIColor whiteColor];
    [self addSubview:topView];
    [topView release];
    
    // 标题
    self.title = [[UILabel alloc] initWithFrame:CGRectMake(40, 30, self.frame.size.width - 30, 20)];
    _title.textAlignment = NSTextAlignmentCenter;
    [topView addSubview:_title];
    [_title release];
    
    // 下面的view
    self.view = [[UIView alloc] initWithFrame:CGRectMake(30, 100, self.frame.size.width - 60, self.frame.size.height - 100)];
    _view.backgroundColor = [UIColor whiteColor];
    [self addSubview:_view];
    [_view release];
    
    
    UILabel *lab1 = [[UILabel alloc] initWithFrame:CGRectMake(10, 10, 80, 30)];
    lab1.text = @"专辑名称";
    lab1.textColor = [UIColor grayColor];
    [_view addSubview:lab1];
    [lab1 release];
    
    
    self.name = [[UILabel alloc] initWithFrame:CGRectMake(85, 10, self.view.frame.size.width - 85, 30)];
    [_view addSubview:_name];
    [_name release];
    
    
    UILabel *lab2 = [[UILabel alloc] initWithFrame:CGRectMake(10, 70, 80, 30)];
    lab2.text = @"创建人";
    lab2.textColor = [UIColor grayColor];
    [_view addSubview:lab2];
    [lab2 release];
    
    
    self.creater = [[UILabel alloc] initWithFrame:CGRectMake(85, 70, self.view.frame.size.width - 80, 30)];
    [_view addSubview:_creater];
    [_creater release];
    
    
    UILabel *lab3 = [[UILabel alloc] initWithFrame:CGRectMake(10, 130, 80, 30)];
    lab3.text = @"简介";
    lab3.textColor = [UIColor grayColor];
    [_view addSubview:lab3];
    [lab3 release];
    
    self.scroll = [[UIScrollView alloc] initWithFrame:CGRectMake(70,130, self.view.frame.size.width - 70, self.view.frame.size.height - 130)];
    _scroll.bounces = NO;
    _scroll.showsVerticalScrollIndicator = NO;
    [self.view addSubview:_scroll];
    [_scroll release];
    self.intro = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, self.scroll.frame.size.width - 10, self.view.frame.size.height - 130)];
    _intro.numberOfLines = 0;
    [_scroll addSubview:_intro];
    [_intro release];
    


}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
